<?php
	// Conexao
    $sql_connect = mysql_connect("localhost", "root", "tvcb") or die ("no DB Connection");
    mysql_select_db("gameon") or die ("DB not found");
	
    // Consulta
    $usuario = $_POST['usuario'];
    $senha   = $_POST['senha'];
	
    $query = "SELECT * FROM login where usuario = '$usuario' and senha = '$senha' ";
	$result = mysql_query($query);
        
    $num_results = mysql_num_rows($result);  
 
    if($num_results > 0)
    {
		// Retorna para o unity o echo
         $row = mysql_fetch_array($result);
		 echo $row['idLogin'];
    }
	
    mysql_close($sql_connect);
?>